package com.atguigu.demo.customer0222.mapper;


import com.atguigu.demo.customer0222.bean.Customer;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
@DS("demo")
public interface CustomerMapper extends BaseMapper<Customer> {

    @Insert("insert into customer(name,age) values(  #{cus.name} ,#{cus.age}  ) ")
    public void insertCustomer(@Param("cus") Customer customer);

    @Select("${sql}")
    public void  selectSQL(@Param("sql") String sql );


    @Select("select id,name,age from customer where age = #{age}")
    public List<Customer> selectCustomerByAge(@Param("age") Integer age);

    //补充update和 delete
}
